<!DOCTYPE HTML>
<html>
<head>
<#include "WEB-INF/view/_frag/meta.ftl">
<#include "WEB-INF/view/_frag/jscss.ftl">
<title>退役军人管理系统</title>
</head>

<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />
<!--  <div class="header"></div>-->

<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form form-horizontal" action="${basePath}/index/index" method="post">
      <div class="row cl">
        <label class="form-label col-xs-3" style="font-size:16px"><i class="Hui-iconfont">&#xe60d;</i>&nbsp;&nbsp;账号</label>
        <div class="formControls col-xs-8">
          <input id="loginname" name="loginname" type="text" placeholder="账号" class="input-text radius size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3" style="font-size:16px"><i class="Hui-iconfont">&#xe60e;</i>&nbsp;&nbsp;密码</label>
        <div class="formControls col-xs-8">
          <input id="password" name="password" type="password" placeholder="密码" class="input-text radius size-L">
        </div>
      </div>
      <div class="row cl" style="padding:0 0 0 180px;">
       		<input id="inValiCode" name="inValiCode" type="text" placeholder="验证码" class="input-text radius size-L" style="width:90px;">
			<a href="javascript:void(0);" onclick="_verification_reload()" ><img id="_verification"  style=" width:90px ;height: 40px;" src="${basePath}/index/writeImgae"/></a>
	  </div>
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input  type="button" onclick="return check()" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>

<!-- <div class="footer">Copyright  by 申瓯通信设备有限公司</div> -->
	<script>
		if (self != top) {
			parent.window.location.replace(window.location.href);
		}
		function check() {
			var loginname = $("#loginname").val();
			var password = $("#password").val();
			var code = $("#inValiCode").val();
			$.post("${basePath}/index/checkout", {
				login_name : loginname,
				password : password,
				code : code
			}, function(data) {
				if (data == -1) {
					layer.alert("验证码错误",{icon:0});
				} else if (data == -2) {
					layer.alert("请先退出其它登录。",{icon:0});
				} else if (data == 0) {
					window.location.href = "${basePath}/index/index";
				} else if (data == 1) {
					layer.alert("无此用户",{icon:0});
				} else {
					layer.alert("密码不正确",{icon:0});
				}
			});
		}
		
		function _verification_reload(){
			$("#_verification").attr("src","${basePath}/index/writeImgae?a="+Math.random());
		}
	</script>
</body>
</html>